import { AppRouteObject } from '#/router.ts';
import AuthGuard from '@/router/components/AuthGuard.tsx';
import Login from '@/pages/system/login/Login.tsx';
import ILayout from '@/layouts';
import settings from '@/router/routes/modules/settings.tsx';
import errors from '@/router/routes/modules/errors.tsx';
import eventCenter from '@/router/routes/modules/eventCenter';
import maintenancePlan from '@/router/routes/modules/maintenancePlan.tsx';
import workOrder from '@/router/routes/modules/workOrder.tsx';
import iot from '@/router/routes/modules/iot.tsx';
import realTimeMonitoring from '@/router/routes/modules/realTimeMonitoring.tsx';
import historyReplay from '@/router/routes/modules/historyReplay.tsx';

export const bizRoutes: AppRouteObject[] = [
  settings,
  eventCenter,
  maintenancePlan,
  workOrder,
  iot,
  realTimeMonitoring,
  historyReplay,
  {
    path: 'personal-center',
    meta: {
      label: '个人中心',
      hideMenu: true,
      key: '/personal-center',
      permissions: [],
    },
    element: <>personal center</>,
  },
];

export const routes: AppRouteObject[] = [
  {
    path: '/',
    element: (
      <AuthGuard>
        <ILayout />
      </AuthGuard>
    ),
    children: [...bizRoutes, ...errors],
  },
  {
    path: 'login',
    element: <Login />,
  },
];
